home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group93c.txt / 000044_icon-group-sender _Tue Sep 7 10:51:47 1993.msg < prev    next >
Internet Message Format  |  1994-02-02  |  2KB

  1. Received: from owl.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 7 Sep 1993 09:02:42 MST
  2. Received: by owl.cs.arizona.edu; Tue, 7 Sep 1993 09:02:41 MST
  3. Date: Tue, 07 Sep 1993 10:51:47 -0600 (CST)
  4. From: Chris Tenaglia - 257-8765 <TENAGLIA@MIS.MCW.EDU>
  5. Subject: Re: return results
  6. To: icon-group@cs.arizona.edu
  7. Message-Id: <01H2NWSUY7428WWOAL@mis.mcw.edu>
  8. Organization: Medical College of Wisconsin (Milwaukee, WI)
  9. X-Vms-To: IN%"icon-group@cs.arizona.edu"
  10. Mime-Version: 1.0
  11. Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  12. Content-Transfer-Encoding: 7BIT
  13. Status: R
  14. Errors-To: icon-group-errors@cs.arizona.edu
  15.  
  16.  
  17. I have occasions to use this too. I think it depends on whether the results
  18. are part of a series. Then the 'suspend' approach is better suited. I have
  19. shied away from records, and return lists in most other cases. I think it
  20. may also be handy to return a table. Then you can have random access to the
  21. multiple results by some key.
  22.  
  23.           procedure called()
  24.             result := table("n/a")
  25.             result["value"] := operation1()
  26.             result["fudge"] := operation2()
  27.             result["guess"] := operation3()
  28.             result["speci"] := operation4()
  29.             result["quant"] := 6
  30.             result["keys"]  := "value fudge guess spec quant keys"
  31.             return result
  32.             end
  33. ...
  34.           query := called()
  35.  
  36.           Then query["keys"] returns the names of the keys. Well a
  37.           key(query) could cycle between them too. Also query["quant"]
  38.           returns the number keys. I suppose you caould pack all sorts
  39.           of meta-information into something that returns a table. Mostly
  40.           I like the freedom to use all, some, one or none of the results
  41.           in any random order. I don't use this yet, but this stream of
  42.           inspired the idea (maybe in parallel with many others.
  43.  
  44. Chris Tenaglia (System Manager) |  "The past explained,     
  45. Medical College of Wisconsin    |   the future fortold, 
  46. 8701 W. Watertown Plank Rd.     |   the present largely appologized for."
  47. Milwaukee, WI 53226             |   Organon to The Doctor
  48. (414)257-8765                   |     
  49. tenaglia@mis.mcw.edu
  50.  
  51.